home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Introducción a Windows Forms / InheritHelloWorld / InheritHelloWorld.cs next >
Encoding:
Text File  |  2001-01-15  |  691 b   |  25 lines

  1. //------------------------------------------------
  2. // InheritHelloWorld.cs ⌐ 2001 by Charles Petzold
  3. //------------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class InheritHelloWorld: HelloWorld
  9. {
  10.      public new static void Main()
  11.      {
  12.           Application.Run(new InheritHelloWorld());
  13.      }
  14.      public InheritHelloWorld()
  15.      {
  16.           Text = "Inherit " + Text;
  17.      }
  18.      protected override void OnPaint(PaintEventArgs pea)
  19.      {
  20.           Graphics grfx = pea.Graphics;
  21.  
  22.           grfx.DrawString("Hello from InheritHelloWorld!", 
  23.                           Font, Brushes.Black, 0, 100);
  24.      }
  25. }